package gui;

import java.awt.BorderLayout;
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;

import javax.swing.JButton;
import javax.swing.JFrame;
import javax.swing.JLabel;
import javax.swing.JPanel;
import javax.swing.JTextField;
import javax.swing.JTextPane;

import Controlador.Controlador;
import Controlador.ControladorArchivo;
import Controlador.ControladorProveedor;
import beans.Proveedor;





/**
* This code was edited or generated using CloudGarden's Jigloo
* SWT/Swing GUI Builder, which is free for non-commercial
* use. If Jigloo is being used commercially (ie, by a corporation,
* company or business for any purpose whatever) then you
* should purchase a license for each developer using Jigloo.
* Please visit www.cloudgarden.com for details.
* Use of Jigloo implies acceptance of these licensing terms.
* A COMMERCIAL LICENSE HAS NOT BEEN PURCHASED FOR
* THIS MACHINE, SO JIGLOO OR THIS CODE CANNOT BE USED
* LEGALLY FOR ANY CORPORATE OR COMMERCIAL PURPOSE.
*/
public class CompraRodamientoFrame extends Vista {

	{
		try {
			javax.swing.UIManager.setLookAndFeel("javax.swing.plaf.metal.MetalLookAndFeel");
		} catch(Exception e) {
			e.printStackTrace();
		}
	}

	private JFrame ventana = new JFrame();
	
	

	public static void main(String[] args) {
		CompraRodamientoFrame p = new CompraRodamientoFrame();
		Controlador proveedor= new ControladorProveedor(p);
		p.addcontroladorproveedor(proveedor);
		
	} 
	

	public CompraRodamientoFrame()
	{
		super();
		initGUI();
	}
	
	
	private void initGUI() {
		try {
			{
				jLabel1 = new JLabel();
				ventana.getContentPane().add(jLabel1, "Center");
				jLabel1.setText("Proveedores");
				jLabel1.setPreferredSize(new java.awt.Dimension(489, 14));
				jLabel1.setBounds(0, 0, 0, 0);
			}
			{
				jPanel1 = new JPanel();
				ventana.getContentPane().add(jPanel1, "Center");
				jPanel1.setLayout(null);
				jPanel1.setPreferredSize(new java.awt.Dimension(470, 164));
				jPanel1.setBounds(0, 0, 0, 0);

				{
					JButtonaceptar = new JButton();
					jPanel1.add(JButtonaceptar);
					JButtonaceptar.setText("Aceptar");
					JButtonaceptar.setBounds(141, 130, 88, 23);
					JButtonaceptar.addActionListener(new ActionListener() {
						public void actionPerformed(ActionEvent evt) {
							JButtonaceptarActionPerformed(evt);
						}
					});
				}
				ventana.setLocationRelativeTo(null);
				ventana.setVisible(true);
				ventana.getContentPane().setLayout(null);
				ventana.setPreferredSize(new java.awt.Dimension(387, 226));
				ventana.pack();
				ventana.setSize(387, 226);
			}
			{
				jLabel1 = new JLabel();
				ventana.getContentPane().add(jLabel1);
				jLabel1.setText("Compra Rodamientos");
				jLabel1.setBounds(12, 12, 123, 16);
			}
			{
				jTextPane1 = new JTextPane();
				ventana.getContentPane().add(jTextPane1);
				jTextPane1.setText("Compra a los proveedores los items indicados en la solicitud de compra enviada por la oficina de ventas"+
						"\n\rSalida XML detallando la orden de compra generada"+
						"\n\r C://ordenCompra.xml");
				jTextPane1.setBounds(12, 40, 355, 110);
			}
			{
				jButton1 = new JButton();
				ventana.getContentPane().add(jButton1);
				jButton1.setText("Generar");
				jButton1.setBounds(144, 162, 80, 26);
				jButton1.addActionListener(new ActionListener() {
					public void actionPerformed(ActionEvent evt) {
						ControladorArchivo ca=((ControladorArchivo)getControladorarchivo());
						ca.generarXMLordenesCompra();
					}
				});
			}
		} catch(Exception e) {
			e.printStackTrace();
		}
	}
	
	
	private void JButtonaceptarActionPerformed(ActionEvent evt) {
//		Proveedor prov;
//		prov=((ControladorProveedor)getControladorProveedor()).buscarProveedor(txtrazonsocial.getText());
//		if (prov!=null){
//		((ControladorProveedor)getControladorProveedor()).bajaProveedor(prov);
//		borrarTextos();
//		}
	}
	
	
	public JFrame getVentana() {
		return ventana;
	}

	private void btncancelarActionPerformed(ActionEvent evt) {
		//System.exit(0);
		this.ventana.dispose();
	}
	
	
	
	
	private JPanel jPanel1;
	private JTextPane jTextPane1;
	private JButton jButton1;
	private JLabel jLabel1;
	private JButton JButtonaceptar;

}

